﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ArgusLight.Fractals2D.ComplexFractalColoring.IterationBased
{
	public class red_yellow : Coloring
	{
		public override Color GetColor(int x, int y)
		{
			byte[] a = GetColorBytes_2(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb(255, a[0], a[1], 0);
		}
	}

	//[Alpha()]
	//public class red_yellow_smooth : SmoothColoring
	//{
	//	public override Color GetColor(int x, int y)
	//	{
	//		if (this.data.iterations[x, y] >= this.fractalParameter.Iterations)
	//			return Colors.Black;
	//		//int i = (int)(this.GetSmootheningFactor(x, y) * (this.fractalParameter.Iterations - 1));
	//		//byte[] a = GetColorBytes_2(i, this.fractalParameter.Iterations);
	//		//return Color.FromArgb(255, a[0], a[1], 0);
	//		double a = this.GetSmootheningFactor(x, y);
	//		if (a < 0.25)
	//			return Colors.Red;
	//		if (a < 0.5)
	//			return Colors.Green;
	//		if (a < 0.75)
	//			return Colors.Blue;
	//		if (a > 1)
	//			return Colors.Purple;
	//		return Colors.White;
	//	}
	//}

	public class black_white : Coloring
	{
	}

	public class border_only : Coloring
	{
		public override Color GetColor(int x, int y)
		{
			if (this.data.iterations[x, y] >= this.fractalParameter.Iterations)
				return Colors.White;
			return Colors.Black;
		}
	}

	public class blue_turquoise : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_2(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb(255, 0, a[1], a[0]);
		}
	}

	public class green_yellow : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_2(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb(255, a[1], a[0], 0);
		}
	}

	public class red : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_2(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb((byte)(255 - a[1]), a[0], 0, 0);
		}
	}

	public class blue : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_2(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb((byte)(255 - a[1]), 0, 0, a[0]);
		}
	}

	public class green : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_2(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb((byte)(255 - a[1]), 0, a[0], 0);
		}
	}

	public class violette : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_2(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb((byte)(255 - a[1]), (byte)((a[0] + a[1]) / 2), 0, (byte)((a[0] + a[1]) / 2));
		}
	}

	public class yellow : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_2(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb((byte)(255 - a[1]), (byte)((a[0] + a[1]) / 2), (byte)((a[0] + a[1]) / 2), 0);
		}
	}

	public class turquoise : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_2(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb((byte)(255 - a[1]), 0, (byte)((a[0] + a[1]) / 2), (byte)((a[0] + a[1]) / 2));
		}
	}

	public class red_green_blue : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_3(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb(255, a[0], a[1], a[2]);
		}
	}

	public class green_blue_red : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_3(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb(255, a[1], a[2], a[0]);
		}
	}

	public class blue_red_green : Coloring
	{
		public override Color GetColor(Int32 x, Int32 y)
		{
			byte[] a = GetColorBytes_3(this.data.iterations[x, y], this.fractalParameter.Iterations);
			return Color.FromArgb(255, a[2], a[0], a[1]);
		}
	}
}
